package com.example.config;

import org.springframework.cloud.gateway.filter.GatewayFilter;
import org.springframework.cloud.gateway.filter.factory.AbstractGatewayFilterFactory;
import org.springframework.stereotype.Component;

/**
 * 自定义过滤器第一种写法
 */

/**
 * 自定义过滤器工厂，把RequestTimeFilter加入
 */
@Component
public class RequestTimeGatewayFilterFactory extends AbstractGatewayFilterFactory<Object> {

    public GatewayFilter apply(Object config) {
        return new RequestTimeFilter();
    }
}
